/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package biofilter.util;

import biofilter.records.Record;
import java.util.Collection;
import java.util.Iterator;

/**
 * This class provides basic utilities for prininting and manipulating Arrays
 * @author Daniel Quest
 * @date   Dec 21 2009
 */
public class ArrayUtil {

    public ArrayUtil(){

    }

    public void printArray(Record s[]){
         for(int i = 0; i<s.length; i++){
            System.out.println(s[i].get());
        }
    }

    public void printArray(String s[]){
        for(int i = 0; i<s.length; i++){
            System.out.println(s[i]);
        }
    }

    public Record[] toArray(Collection<Record> c){
        Record[] r = new Record[c.size()];
        Iterator<Record> i = c.iterator();
        int count = 0;
        while(i.hasNext()){
            r[count] = (Record) i.next();
            count++;
        }
        return r;
    }
}
